home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bytesc88.arc / EXIT.C < prev    next >
Text File  |  1987-10-04  |  640b  |  26 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. #include stdio.h
  3. #include clib.def
  4. /*
  5. ** Close all open files and exit to CP/M. 
  6. ** Entry: errcode = Character to be sent to stderr.
  7. ** Returns to CP/M rather than the caller.
  8. */
  9. exit(errcode) char errcode; {
  10.   int fd;
  11.   if(errcode) Uconout(errcode);
  12. /* Following code not needed for MS-DOS (given that we
  13. ** are using function 4C to terminate -- it closes
  14. ** active handles for us).
  15. */
  16.  
  17. /*  for(fd=0; fd < MAXFILES; fclose(fd++)); */
  18.  
  19.   Umsdos(0,0,0,19456);  /* 19456 = 4C00H, 4C in AH terminates */
  20.   }
  21. #asm
  22. _abort: JMP    _exit
  23.        PUBLIC  _abort
  24. #endasm
  25.  
  26.